home *** CD-ROM | disk | FTP | other *** search
- ' 1. opens AMORTIZE.XLS
- ' 2. plugs in values for the variables
- ' 3. and pops the calculated payment up in a message box
- ' C7 =Loan_amount
- ' C8 =Annual_interest_rate
- ' C9 =Term_in_years
- ' C10 =Payments_per_year
- ' C14 =Calculated_payment
-
- Dim APPXL As object
- Dim XL As object
- Dim ws As object
-
- Set APPXL = GetObject(, "Excel.Application")
- Set XL = APPXL.Application
- XL.WorkBooks.Open "F:\TEMP\AMORTIZE.XLS"
- Set ws = XL.ActiveSheet
- ws.Range("Loan_amount").Value = 100000
- ws.Range("Annual_interest_rate").Value = .075
- ws.Range("Term_in_years").Value = 30
- ws.Range("Payments_per_year").Value = 12
- MsgBox Format$(ws.Range("Calculated_payment").Value, "currency"), , "Payment"
- XL.Workbooks(1).[Close] (False)
-
- Set ws = Nothing
- Set XL = Nothing
- Set APPXL = Nothing
-